package com.kylin.domain.merchant.provider;

import com.kylin.domain.merchant.command.QueryMerchantCommand;
import com.kylin.shared.common.PageResults;
import com.kylin.shared.common.FunctionProvider;
import lombok.extern.slf4j.Slf4j;
import org.axonframework.commandhandling.gateway.CommandGateway;
import org.axonframework.eventhandling.gateway.EventGateway;
import org.axonframework.queryhandling.QueryGateway;
import org.springframework.stereotype.Component;

/**
 * 麒麟商户操作类
 * @author Wall.
 * @version v1.0.1
 * @date 2020年01月14日 18:28
 */
@Slf4j
@Component
public final class MerchantProvider extends FunctionProvider {

    public MerchantProvider(QueryGateway queryGateway,
                            CommandGateway commandGateway,
                            EventGateway eventGateway) {
        super(queryGateway, commandGateway, eventGateway);
    }

    public PageResults findMerchants(QueryMerchantCommand command) {
        return executeQuery(command, PageResults.class);
    }

}
